﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace HengTong.DataAccess.Migrations
{
    /// <inheritdoc />
    public partial class 请假辞退增加证明文件字段 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<Guid>(
                name: "SupportingDocumentId",
                table: "SysHrDismissRequestBill",
                type: "uniqueidentifier",
                nullable: true);

            migrationBuilder.AddColumn<Guid>(
                name: "SupportingDocumentId",
                table: "SysDailyLeaveRequestBill",
                type: "uniqueidentifier",
                nullable: true);

            migrationBuilder.CreateIndex(
                name: "IX_SysHrDismissRequestBill_SupportingDocumentId",
                table: "SysHrDismissRequestBill",
                column: "SupportingDocumentId");

            migrationBuilder.CreateIndex(
                name: "IX_SysDailyLeaveRequestBill_SupportingDocumentId",
                table: "SysDailyLeaveRequestBill",
                column: "SupportingDocumentId");

            migrationBuilder.AddForeignKey(
                name: "FK_SysDailyLeaveRequestBill_FileAttachments_SupportingDocumentId",
                table: "SysDailyLeaveRequestBill",
                column: "SupportingDocumentId",
                principalTable: "FileAttachments",
                principalColumn: "ID",
                onDelete: ReferentialAction.Restrict);

            migrationBuilder.AddForeignKey(
                name: "FK_SysHrDismissRequestBill_FileAttachments_SupportingDocumentId",
                table: "SysHrDismissRequestBill",
                column: "SupportingDocumentId",
                principalTable: "FileAttachments",
                principalColumn: "ID",
                onDelete: ReferentialAction.Restrict);
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_SysDailyLeaveRequestBill_FileAttachments_SupportingDocumentId",
                table: "SysDailyLeaveRequestBill");

            migrationBuilder.DropForeignKey(
                name: "FK_SysHrDismissRequestBill_FileAttachments_SupportingDocumentId",
                table: "SysHrDismissRequestBill");

            migrationBuilder.DropIndex(
                name: "IX_SysHrDismissRequestBill_SupportingDocumentId",
                table: "SysHrDismissRequestBill");

            migrationBuilder.DropIndex(
                name: "IX_SysDailyLeaveRequestBill_SupportingDocumentId",
                table: "SysDailyLeaveRequestBill");

            migrationBuilder.DropColumn(
                name: "SupportingDocumentId",
                table: "SysHrDismissRequestBill");

            migrationBuilder.DropColumn(
                name: "SupportingDocumentId",
                table: "SysDailyLeaveRequestBill");
        }
    }
}
